<?php

namespace CNEPAdmin\Controller;

use CNEPAdmin\Controller\CommonController;

class UserCardController extends CommonController {

    protected $_modelName = "UserCard";

    protected function setCode() {
        $this->_code = "User";
    }

    public function index() {
        $this->display();
    }

    /**
     * 查看列表
     */
    public function cardList() {
        $this->checkPriv('ur', 1); // 权限

        $userID = intval(I("userID"));
        $list = D("UserCard")->getUserCardList($userID);
        $desc = '';
        if ($list) {
            foreach ($list as $key => $value) {
                $list[$key]['addTime'] = date("Y/m/d H:i:s",$value['addTime']);
            }
            $count = count($list);
        } else {
            $list = array();
            $count = 0;
        }
        $this->ajaxReturn(array(
            'result' => 1, 'list' => $list, 'desc'=>$desc,'totalRow'=>$count
        ));
    }

}
